<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>innerHTML</title>
    <script>
        function change(id){
            elem = document.getElementById(id);
            if(elem.innerHTML.match("你好")){
                elem.innerHTML="Fuck you!";
            }else{
                elem.innerHTML="不好意思，说错了嘴。你好，你好。呵呵呵呵";
            }
        }
    </script>
</head>
<body>
    <button type="button" onclick="change('content')">改变内容</button>
    <h1><span id="content">你好</span></h1>
</body>
</html>